
#ifndef _MACRO_H_
#define _MACRO_H_

#include "NLogic/Function.h"
#include "Encryption.h"
#include "system/config.h"
#include "Config.h"

#define FILELOG(...)	::Logger::GETLOG()->ToFile(::Logger::DEBUG, __VA_ARGS__)

#define ADDCMD(ns, cmd)		AddCommand(CMD_##cmd, ProjectZ::NCommand::ns::cmd::OnExecute)

#define PREPARE_PACKET	pUser->UpdateLatency();						\
							::ProjectZ::Encryption::Instance().Decrypt(pPacket);	\


#define STRESSTEST(...) 																		\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}

#define DEBUGLOG(...) 																		\
	if (true == ::ProjectZ::Config::Instance().GetResourceDatabase()._useDebugLog)	\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}																							\

#define JJAEHUNYLOG(...) 																	\
	if (true == ::ProjectZ::Config::Instance().GetResourceDatabase()._useDebugLog)	\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}																							\

#define STRESSLOG(...) 																		\
	if (true == ::ProjectZ::Config::Instance().GetResourceDatabase()._useStressLog)	\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}																							\

#define PROCESSLOG(...) 																		\
	if (true == ::ProjectZ::Config::Instance().GetResourceDatabase()._useProcessLog)	\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}																							\

#define ERRORLOG(...) 																		\
	if (true == ::ProjectZ::Config::Instance().GetResourceDatabase()._useErrorLog)	\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}																							\

#define TESTLOG(...) 																		\
	if (true == ::ProjectZ::Config::Instance().GetResourceDatabase()._isTest)	\
	{ 																							\
		::Logger::GETLOG()->ToAll(::Logger::DEBUG, __VA_ARGS__);						\
	}

#define ARRAY_LEN(arr)	(sizeof(arr) / sizeof(*arr))

#endif /* _MACRO_H_ */
